//
//  DECXContractObj.m
//  DECXInStore
//
//  Created by 程强 on 2017/7/21.
//  Copyright © 2017年 程强. All rights reserved.
//

#import "DECXContractObj.h"

@implementation DECXContractObj
- (instancetype)initWithResponse:(NSDictionary *)dic
{
    if (self = [super init]) {
        _xid = ValidString(dic[@"id"]);
        _title = ValidString(dic[@"title"]);
        _order_type = ValidString(dic[@"order_type"]);
        _num = ValidString(dic[@"num"]);
        _category_id = ValidString(dic[@"category_id"]);
        _category_name = ValidString(dic[@"category_name"]);
        _other_id = ValidString(dic[@"other_id"]);
        _depot_id = ValidString(dic[@"depot_id"]);
        _user = [[ContractUser alloc]initWithResponse:dic[@"user"]];
    }
    return self;
}
@end


@implementation ContractUser
- (instancetype)initWithResponse:(NSDictionary *)dic
{
    if (self = [super init]) {
        _user_id = ValidString(dic[@"user_id"]);
        _user_name = ValidString(dic[@"user_name"]);
        _user_tname = ValidString(dic[@"user_tname"]);
        _user_phone = ValidString(dic[@"user_phone"]);
        _user_email = ValidString(dic[@"user_email"]);
        _user_tel = ValidString(dic[@"user_tel"]);
        _user_seat = ValidString(dic[@"user_seat"]);
    }
    return self;
}

@end
